<!DOCTYPE html>
<!--嘿嘿-->
<html>
	<head>
	  <meta charset="utf-8">
	  <title></title>
	  <style>
		*{
			margin: 0px;
		}
	    div{
	      width: 200px;
	      height: 200px;
	      background-color: blue;
	      margin: 100px;
	    }
	  </style>    
	</head>
	<body>
	    <script>
	      document.getElementsByTagName('div')[0].onmousemove = function(event){
	        console.log('相对视口坐标：'+event.clientX+','+event.clientY);
	        console.log('相对触发事件对象坐标：'+event.offsetX+','+event.offsetY);
	      }
		  //获取键盘按键的keyCode
		  document.onkeydown = function(event){
		    console.log(event.keyCode);
		  }
	    </script>
	  </body>
<!--徐佳宁嗨害嗨-->
</html>